package be.ac.ua.comp.projectGPT.auctions;

import be.ac.ua.comp.projectGPT.exceptions.InitializationException;
import be.ac.ua.comp.projectGPT.types.English;

/**
 *
 * @author Admin
 */
public class EnglishAuction extends Auction<English> {

    public EnglishAuction() {
        logger.info("Creating");
    }


    public void run() {
        try {
               if(!initialized) {
            throw new InitializationException();
        }
        biddingRound = 1;
        policy.start();
        logger.info("Starting");
        do {
            resetBiddings();
            auctioneer.runBiddingRound();
            biddingRound++;
        } while(policy.stop());
        auctioneer.notifyWinnersAndLosers();
        logger.info("Stopping");
       
        } catch(InitializationException ex) {
            logger.error("InitializationException: "+ex.getLocalizedMessage());
        }
    }

}
